package com.example.web.entity;

import com.example.web.listener.ObjectChangeListener;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

/**
 * before persist is called for a new entity – @PrePersist
 * after persist is called for a new entity – @PostPersist
 * before an entity is removed – @PreRemove
 * after an entity has been deleted – @PostRemove
 * before the update operation – @PreUpdate
 * after an entity is updated – @PostUpdate
 * after an entity has been loaded – @PostLoad
 */
@Table(name = "t_goods")
@Entity
@Data
@EntityListeners(ObjectChangeListener.class)
public class Goods {

    @GeneratedValue
    @Id
    private Long id;

    @Column
    private String name;

    @Column
    private BigDecimal price;

}
